'use strict';
const { createHash } = require('crypto');
const { rule } = require('postcss/lib/postcss');

module.exports = env => {
  const hash = createHash('md5');
  hash.update(JSON.stringify(env));
  module: {
    rules: [
      {
        test: /\.css$/,
        use: [
          'style-loader',
          {
            loader: "css-loader",
            options: {
              localIdentName: '[path][name]__[local]--[hash:base64:5]'
            }
          }
        ]
      }
    ]
  }
  return hash.digest('hex');
};
